package com.twu.biblioteca.DataBase;

public class Item {
    public boolean isCheckOut;
    protected String name;
    protected long serialNumber;
    public ItemType itemType;

    public Item(long serialNumber, String name) {
        this.isCheckOut = false;
        this.serialNumber = serialNumber;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public long getSerialNumber() {
        return serialNumber;
    }

    public void checkOut() {
        if(this.isCheckOut == false){
            this.isCheckOut = true;
            System.out.println("Thank you! Enjoy the book");
            return;
        }
        System.out.println(this.name + " is not available.");
        return;
    }

    public void returnItem(){
        if(this.isCheckOut == true){
            this.isCheckOut = false;
            System.out.println("Thank you for returning it.");
            return;
        }
        System.out.println(this.name + " is not a valid item to return!");
        return;
    }

    public ItemType getItemType() {
        return itemType;
    }
}
